
<template>
	  <div class="tc-usermanage-details">
      <div class="title">用户详情</div>
      <section class="add-content">
        <div class="add-content-title">基本信息</div>
        <el-form :model="formData" ref="formData" label-width="100px" class="demo-formData">
          <div class="item-box clearfix">
            <el-form-item class="content-box" label="账号：">
              <div>{{formData.userName}}</div>
            </el-form-item>
            <el-form-item class="content-box" label="用户名：">
              <div>{{formData.nickName}}</div>
            </el-form-item>
          </div>
          <div class="item-box clearfix">
            <el-form-item class="content-box" label="部门：">
              <div v-if="formData.sysDeptList.length > 0">
                <span style="padding-left: 5px" v-for="(item, index) in formData.sysDeptList" :key="index">
                  {{item.deptName}}{{index === formData.sysDeptList.length - 1 ? '' : ','}}
                </span>
              </div>
            </el-form-item>
            <el-form-item class="content-box" label="角色：">
              <div v-if="formData.sysRoleList.length > 0">
                <span style="padding-left: 5px" v-for="(item, index) in formData.sysRoleList" :key="index">
                  {{item.roleName}}{{index === formData.sysRoleList.length - 1 ? '' : ','}}
                </span>
              </div>
            </el-form-item>
          </div>
          <div class="item-box clearfix">
            <el-form-item class="content-box" label="岗位：">
              <div v-if="formData.sysPostList.length > 0">
                <span style="padding-left: 5px" v-for="(item, index) in formData.sysPostList" :key="index">
                  {{item.postName}}{{index === formData.sysPostList.length - 1 ? '' : ','}}
                </span>
              </div>
            </el-form-item>
            <el-form-item class="content-box" label="小组：">
              <div v-if="formData.sysGroupList.length > 0">
                <span style="padding-left: 5px" v-for="(item, index) in formData.sysGroupList" :key="index">
                  <span v-if="item">{{item.groupName}}{{index === formData.sysGroupList.length - 1 ? '' : ','}}</span>
                </span>
              </div>
              <div v-else>- -</div>
            </el-form-item>
          </div>
          <div class="item-box clearfix">
            <el-form-item class="content-box" label="状态：">
              <div v-if="formData.status == 0">启用</div>
              <div v-else>停用</div>
            </el-form-item>
          </div>
          <el-form-item label="备注：" prop="textarea">
            <div v-if="formData.remark">{{formData.remark}}</div>
            <div v-else>- -</div>
          </el-form-item>
        </el-form>
        <div class="btm-btn details-btn">
          <el-button class="r" type="primary" @click="goback">返回</el-button>
        </div>
      </section>
    </div>
</template>

<script>
import { getUserDetail } from '@/axios/user/user'

var viewer = null;
export default {
  name: 'operationLog',
  data () {
    return {
      formData: {}
    }
  },
  computed:{
  },
  watch: {
  },
  components: {
  },
  mounted() {
  },
  created(){
    this.initData()
  },
  methods: {
    initData() {
      getUserDetail({
        id: this.$route.query.id
      }).then(res => {
        if (res.code === 200) {
          this.formData = res.data
        }
      })
    },
    goback() {
      this.$router.push({
        path: '/system/user/manage',
        query: {
          pageNum: this.$route.query.pageNum
        }
      })
    }
  }
};
</script>

<style lang="scss">
@import "./index.scss";
</style>